import QtQuick 2.14
import QtQuick.Layouts 1.14
import QtQuick.Controls 2.14
import QtQuick.Controls.Styles 1.4
import QtGraphicalEffects 1.14
import QtQml 2.14

Item {
    id:root
    implicitWidth:   388
    implicitHeight: 475
    Rectangle{
      anchors.fill: parent
      color: "transparent"

      Rectangle {
          id:sizeBox
          width: parent.width
          height: 30
          visible: false
          color:"transparent"
          RowLayout{
              anchors.fill: parent
              spacing: 2

              Rectangle{
                 Layout.fillWidth: true
              }

              Label{
                  font{
                      family: "Microsoft YaHei"
                      pixelSize: 20
                  }
                  text: qsTr('Size:')
                  color: '#000'
                  Layout.alignment: Qt.RightArrow
              }

              Label{
                  id:sizeLabel
                  font{
                      family: "Microsoft YaHei"
                      pixelSize: 20
                      bold: true
                      italic: true
                  }
                  text: ''
                  color: '#1989FA'
                  Layout.alignment: Qt.RightArrow
              }

              Label{
                  font{
                      family: "Microsoft YaHei"
                      pixelSize: 20
                  }
                  text: 'MB'
                  color: '#000'
                  Layout.alignment: Qt.RightArrow
                  Layout.rightMargin: 8
              }
          }
      }

      Rectangle{
         id:mainPanel
         width: 260
         height: 300
         anchors.horizontalCenter: parent.horizontalCenter
         anchors.verticalCenter: parent.verticalCenter
         anchors.verticalCenterOffset: -5

         Rectangle{
           height: mainPic.height
           width: mainPic.width
           anchors.centerIn: parent
           layer.enabled: true
           layer.effect: DropShadow{
               radius:10
               samples: 20
               color: "#464646"
               horizontalOffset: 0
               verticalOffset: 0
               spread: 0
           }
           Image{
                sourceSize: Qt.size(40,40)
                fillMode: Image.Tile
                anchors.fill: parent
                source:"qrc:/imgs/grid.png"
           }
         }

         Image{
             id: mainPic
             source: ""
             sourceSize: Qt.size(260,300)
             anchors.centerIn: parent
             cache: false
             asynchronous: true
             //fillMode: Image.PreserveAspectFit
             //顶部宽度显示
             ExSizeIndicator{
                 id:topIndicator
                 visible: false
                 width: mainPic.width
                 height: 6
                 length: "0"
                 enabled: false
                 anchors.bottom: mainPic.top
                 anchors.bottomMargin: 35
                 anchors.horizontalCenter: parent.horizontalCenter
             }
             //右边高度显示
             ExSizeIndicator{
                 id:rightIndicator
                 width: mainPic.height
                 visible: false
                 height: 20
                 length: "0"
                 enabled: false
                 anchors.left: mainPic.right
                 anchors.leftMargin:-mainPic.height/2 + 30
                 anchors.verticalCenter: parent.verticalCenter
                 rotation: 90
             }
         }

         Label{
             id:fileNameText
             visible: false
             width: parent.width
             lineHeight: 1
             anchors.top: mainPic.bottom
             anchors.topMargin: 10
             text: ""
             font{
                 family: "Microsoft YaHei"
                 pixelSize: 18
                 bold: true
             }
             wrapMode: Text.WrapAnywhere
             elide: Text.ElideRight
             horizontalAlignment: Text.AlignHCenter
             maximumLineCount: 3
         }
      }
    }
}
